<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<link href="css/login2.css" type="text/css" rel="stylesheet" />
		<title>氦压机远程监控系统</title>
	</head>
	<style>
		body {
			margin: 0;
			padding: 0;
			font: 12px/1.5 helvetica, arial, "Microsoft YaHei", \5b8b\4f53;
		}
		
		div,
		dl,
		dt,
		dd,
		ul,
		ol,
		li,
		h1,
		h2,
		h3,
		h4,
		h5,
		h6,
		pre,
		form,
		fieldset,
		input,
		textarea,
		blockquote,
		p {
			padding: 0;
			margin: 0;
		}
		
		table,
		td,
		tr,
		th {
			font-size: 12px;
		}
		
		ol,
		ul {
			list-style: none;
		}
		
		li {
			list-style-type: none;
		}
		
		img {
			vertical-align: top;
			border: 0;
			max-width: 100%;
			height: auto;
		}
		
		h1,
		h2,
		h3,
		h4,
		h5,
		h6 {
			font-size: inherit;
			font-weight: normal;
		}
		
		address,
		cite,
		code,
		em,
		th,
		i,
		var {
			font-weight: normal;
			font-style: normal;
		}
		
		input {
			outline: 0;
			outline: none;
		}
		
		body,
		html {
			width: 100%;
			height: 100%
		}
		
		input::-webkit-input-placeholder {
			color: #6D7795;
		}
		
		input::-moz-placeholder {
			/* Mozilla Firefox 19+ */
			color: #6D7795;
		}
		
		input:-moz-placeholder {
			/* Mozilla Firefox 4 to 18 */
			color: #6D7795;
		}
		
		input:-ms-input-placeholder {
			/* Internet Explorer 10-11 */
			color: #6D7795;
		}
		
		body {
			background: -webkit-linear-gradient(right top, #51767A, #434B63, #434B63);
			/* Safari 5.1 - 6.0 */
			background: -o-linear-gradient(bottom left, #51767A, #434B63, #434B63);
			/* Opera 11.1 - 12.0 */
			background: -moz-linear-gradient(bottom left, #51767A, #434B63, #434B63);
			/* Firefox 3.6 - 15 */
			background: linear-gradient(to bottom left, #51767A, #434B63, #434B63);
		}
		
		.login_Box {
			width: 600px;
			/*height: 400px;*/
			margin: auto;
			/*padding-top: 200px;*/
		}
		
		.logo_Box {
			width: 290px;
			float: left;
			border-right: 1px solid #6D7795;
			height: 260px;
		}
		
		.logo_Box img {
			display: block;
			margin: auto;
			margin-top: 40px;
		}
		
		.login {
			width: 200px;
			padding: 0 50px;
			float: left;
		}
		
		.login_Top {
			color: white;
			padding: 10px 0;
		}
		
		.login_Input {
			border-bottom: 1px solid #6D7795;
			width: 90%;
			padding: 8px 5%;
			margin-top: 20px;
		}
		
		.login_Input input {
			width: 100%;
			border: none;
			outline: none;
			background: none;
		}
		
		.btn_Login {
			width: 100%;
			color: white;
			border-radius: 100px;
			line-height: 240%;
			background: #1AD9A8;
			text-align: center;
			margin-top: 40px;
			cursor: pointer;
		}
		
		.btn_Login:hover {
			background: #21C79C
		}
		
		.btn_Auto {
			font-size: 12px;
			text-align: center;
			margin-top: 14px;
			color: white;
			font-weight: 200
		}
	</style>

	<body>
		<div class="margin_Top"></div>
		<div class="login_Box">
			<div class="logo_Box">
				<img src="../images/logo2.png">

			</div>
			<div class="login">
				<div class="login_Top">登录/login</div>
				<div class="login_Input">
					<input id="name" placeholder="请输入登录账号" style="color: black;">
				</div>
				<div class="login_Input">
					<input id="password" type="password" placeholder="请输入登录密码" style="color: black;">
				</div>
				<div class="btn_Login">登录</div>
			</div>
		</div>

		<script src="js/jquery-2.1.1.min.js"></script>
		<script src="../js/configData.js"></script>
		<script src="js/session.js"></script>

		<script type="text/javascript">
			$(function() {
				$('.btn_Login').click(function() {

					var name = $("#name").val();
					var password = $("#password").val();
					// alert(name+password)
					if (name == null || name === "" || password === "" || password == null){
						alert("账户名密码不正确，请核对后重新输入");
					}else{
						//校验用户账号密码
						$.ajax({
							type: "POST",
							url: serverIp + "/HYJ/user/userLogin",
							data: {name:name, password:password},
							dataType: "json",
							success: function(data) {
								// alert(JSON.stringify(data));
								if(data.errorCode == "0"){
									$.session.set(name, password);
									var obj = JSON.stringify(data.result); 
									localStorage.setItem("admin",obj);
									location.href = 'index.html';
								}else{
									alert("账户名密码不正确，请核对后重新输入");
								}
							}
						});
					}
					
					
					
// 					if(name == "hyj" && password == "hyj@7788") {
// 						$.session.set('hyj', 'hyj');
// 						location.href = 'index.html';
// 					} else {
// 						alert("账户名密码不正确，请核对后重新输入");
// 					}
// 
				});
			});

			$(document).keyup(function(event) {
				if(event.keyCode == 13) {
					$(".btn_Login").trigger("click");
				}
			});
		</script>
	</body>

</html>